﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.iOS.LocalNotification
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using System.Collections;
using System.Runtime.CompilerServices;
using UnityEngine.Bindings;
using UnityEngine.Scripting;

#nullable disable
namespace UnityEngine.iOS
{
  /// <summary>
  ///   <para>iOS.LocalNotification is a wrapper around the UILocalNotification class found in the Apple UIKit framework and is only available on iPhoneiPadiPod Touch.</para>
  /// </summary>
  [NativeHeader("PlatformDependent/iPhonePlayer/Notifications.h")]
  [Obsolete("iOS.Notification Services is deprecated. Consider using the Mobile Notifications package (available in the package manager) which implements the UserNotifications framework.")]
  [NativeConditional("PLATFORM_IOS")]
  [RequiredByNativeCode]
  public sealed class LocalNotification
  {
    private IntPtr m_Ptr;
    private static long m_NSReferenceDateTicks = new DateTime(2001, 1, 1, 0, 0, 0, DateTimeKind.Utc).Ticks;

    /// <summary>
    ///   <para>Creates a new local notification.</para>
    /// </summary>
    public LocalNotification() => this.m_Ptr = NotificationHelper.CreateLocal();

    ~LocalNotification() => NotificationHelper.DestroyLocal(this.m_Ptr);

    /// <summary>
    ///   <para>The time zone of the notification's fire date.</para>
    /// </summary>
    public extern string timeZone { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>The calendar type (Gregorian, Chinese, etc) to use for rescheduling the notification.</para>
    /// </summary>
    public extern CalendarIdentifier repeatCalendar { [MethodImpl(MethodImplOptions.InternalCall)] get; [NativeMethod(Name = "NotificationScripting::SetRepeatCalendar", IsFreeFunction = true, HasExplicitThis = true), MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>The calendar interval at which to reschedule the notification.</para>
    /// </summary>
    public extern CalendarUnit repeatInterval { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    [NativeProperty("FireDate")]
    private extern double fireDateImpl { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>The date and time when the system should deliver the notification.</para>
    /// </summary>
    public DateTime fireDate
    {
      get
      {
        return new DateTime((long) (this.fireDateImpl * 10000000.0) + LocalNotification.m_NSReferenceDateTicks);
      }
      set
      {
        this.fireDateImpl = (double) (value.ToUniversalTime().Ticks - LocalNotification.m_NSReferenceDateTicks) / 10000000.0;
      }
    }

    /// <summary>
    ///   <para>The message displayed in the notification alert.</para>
    /// </summary>
    public extern string alertBody { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>A short description of the reason for the alert.</para>
    /// </summary>
    public extern string alertTitle { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>The title of the action button or slider.</para>
    /// </summary>
    public extern string alertAction { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Identifies the image used as the launch image when the user taps the action button.</para>
    /// </summary>
    public extern string alertLaunchImage { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>The name of the sound file to play when an alert is displayed.</para>
    /// </summary>
    public extern string soundName { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>The number to display as the application's icon badge.</para>
    /// </summary>
    public extern int applicationIconBadgeNumber { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>The default system sound. (Read Only)</para>
    /// </summary>
    public static extern string defaultSoundName { [MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>A dictionary for passing custom information to the notified application.</para>
    /// </summary>
    [NativeThrows]
    public extern IDictionary userInfo { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>A boolean value that controls whether the alert action is visible or not.</para>
    /// </summary>
    public extern bool hasAction { [NativeName("HasAction"), MethodImpl(MethodImplOptions.InternalCall)] get; [NativeName("HasAction"), MethodImpl(MethodImplOptions.InternalCall)] set; }

    [MethodImpl(MethodImplOptions.InternalCall)]
    internal extern void Schedule();

    [MethodImpl(MethodImplOptions.InternalCall)]
    internal extern void PresentNow();

    [MethodImpl(MethodImplOptions.InternalCall)]
    internal extern void Cancel();
  }
}
